<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/commons/taglibs.jsp" %>

<rapid:override name="head">
	<title>User新增</title>
	<style type="text/css">
		.line{
			overflow:hidden;
		}
		.button-list{
			padding:10px 0px;
		}
		table.formTable {
			width: 1000px;
			margin: 0px auto;
			border-collapse: collapse;
			margin:10px 10px 10px 10px;
			border-bottom:0px;
			cellspacing:10px;
			cellpadding:10px;
			align:center;
		}
		tbody {
			display: table-row-group;
			vertical-align: middle;
			border-color: inherit;
		}
		table.input {
			border:none;
			line-height:34px;
			align:right;
			border: 1px solid #CCC;
			height: 25px;
			font-weight: bold;
			vertical-align: top;
			text-align: right;
		}
		td{
			border: none;
			height:60px;
			text-align:right;	
		}
		.inline{
			display:inline;
		}
		.childern-table{
			width:100%;
			margin:0px auto;
		}
		childern-table.input{
			line-height:10px;
		}
		.childern-table tr td{
			padding:5px 0px;
			height:30px;
		}
		label {
			display: inline;
			font-size: 16px;
			font-weight:bold;
			line-height: 30px;
			color: #000;
		}
		.required_star{
			color:red;
		}
		table tr td hr {
			margin: 5px 0px;
			border-top-color: #999;
			border:1px;
			line-height: 1.42857143;
			-webkit-margin-before: 0.5em;
			-webkit-margin-after: 0.5em;
			border-top: 1px solid #897979;
		}
		.swfupload{
			left:0px;
		}
		
		.alert-warning.pull-right {
			margin-right: 20px;
			padding: 15px;
			margin-bottom: 20px;
			border: 1px solid transparent;
			border-radius: 4px;
			width: 75%;
			font-size:15pt;
		}
		.pull-right {
			float: right!important;
		}
		.alert-warning {
			color: #8a6d3b;
			background-color: #fcf8e3;
			border-color: #F4BBC3;
			border:1px;
		}
		.alert {
		}
		.line{
			margin:10px 0px 0px 0px;
		}

	</style>
</rapid:override>

<rapid:override name="content">
	<form:form class="form-horizontal" method="post" action="${ctx}/user/student" modelAttribute="user">
		<input class="btn btn-primary" id="submitButton" name="submitButton" type="submit" value="提交" />
		<input class="btn btn-primary" type="button" value="返回列表" onclick="window.location='${ctx}/user'"/>
		<input class="btn btn-primary" type="button" value="后退" onclick="history.back();"/>
		
		<input type="hidden" id="userId" name="userId" value="${user.userId}"/>
		<div class="gridTable">
		<table class="table text-center">
		<%@ include file="form_include.jsp" %>
		</table>
		</div>
	</form:form>
	
	<script>
		
		new Validation(document.forms[0],{onSubmit:true,onFormValidate : function(result,form) {
			var finalResult = result;
			
			//在这里添加自定义验证			
			return disableSubmit(finalResult,'submitButton');
		}});
	</script>
	<style type="text/css">
		span.required{
			color:red;
			font-weight: bold;
		}
		input.required, textarea.required {
			border: 1px solid #00A8E6;
		}
	</style>
</rapid:override>
<rapid:override name="script">
	<script>
	var picker1 = new Pikaday(
		    {
		        field: document.getElementById('birthString'),
		        firstDay: 1,
		        minDate: new Date('1900-01-01'),
		        maxDate: new Date('2020-12-31'),
		        yearRange: [1900,2020]
		    });
	var picker2 = new Pikaday(
		    {
		        field: document.getElementById('createTimeString'),
		        firstDay: 1,
		        minDate: new Date('1900-01-01'),
		        maxDate: new Date('2020-12-31'),
		        yearRange: [1900,2020]
		    });
    
	function checkPassWordConfirm(continueFlag){ 	
		var userPasswordConfirm = $.trim($("#confirmPassword").val());
		if(userPasswordConfirm != null && userPasswordConfirm.length != 0){
			var userPassword = $.trim($("#password").val());
			if(userPassword != userPasswordConfirm){
				continueFlag = false;
				$(".prompt").html("<font color=\"red\">两次输入密码不一致！请重新输入！</font>"); 
				$("#userPasswordConfirm").attr("value",""); 
				$("#userPasswordConfirm").focus().select();
			}else{
				$(".promp").html(""); 
			}
		}else{
			continueFlag = false;
			$(".prompt").html("<font color=\"red\">请输入重复密码！</font>"); 
			$("#userPasswordConfirm").focus().select();
		}
			
		if(continueFlag)
			document.forms[0].submit(); 
	}
</script>
</rapid:override>
<%@ include file="base.jsp" %>
